"""
Routes and views for the flask application.
"""

from datetime import datetime
from flask import render_template, redirect
from FlaskPhotoMemory import app
from FlaskPhotoMemory.utils import FileSanner
param={"title":'Home Page',"year":datetime.now().year,'files':[]}
fc=FileSanner()
@app.route('/')
@app.route('/home')
def home():
    param['files'] =fc.recursiveDir("C:\\Users\\zhengqiao\\Pictures\\img")
    return render_template(
        'index.html',param=param
    )

@app.route('/about_us')
def about_us():
    return render_template("about-us.html",param=param)

@app.route('/blog_details')
def blog_details():
    return render_template("blog-details.html",param=param)

@app.route('/teacher')
def teacher():
    return render_template("teacher.html",param=param)

@app.route('/contact')
def contact():
    """Renders the contact page."""
    return render_template(
        'contact.html',
        title='Contact',
        year=datetime.now().year,
        message='Your contact page.'
    )
@app.route('/shortcode')
def shortcode():
    return render_template("shortcode.html")
@app.route('/about')
def about():
    """Renders the about page."""
    return render_template(
        'about.html',
        title='About',
        year=datetime.now().year,
        message='Your application description page.'
    )

